home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / p2c / p2c 1.21a2.1 / p2c 1.21a2.1.rsrc / TEXT_138_Naming conventions.txt < prev    next >
Encoding:
Text File  |  1994-11-22  |  8.7 KB  |  221 lines

  1. # NAMING CONVENTIONS
  2.  
  3. CodeFileName    %Rs.c    # Name of .c output file for a program,
  4.     # %s=input file name.
  5.  
  6. ModuleFileName    %_S.c    # Name of .c output file for a module,
  7.     # %s=input file name, %S=module name.
  8.  
  9. HeaderFileName    %_S.h    # Name of .h output file for a module,
  10.     # %s=input file name, %S=module name.
  11.  
  12. HeaderFileName2 # If defined, different format to use when
  13.     # generating #include's, otherwise same.
  14.     # May be quoted as in IncludeFrom.
  15.  
  16. SelfIncludeName # Format to apply after HeaderFileName to use
  17.     # when a module includes its own header file.
  18.  
  19. LogFileName %RS.log # Name of log file name for -V mode.
  20.     # %s=input file name, %S=output file name.
  21.  
  22. IncludeFileName # Format for translating Pascal include-file
  23.     # names.
  24.  
  25. IncludeOutFileName  %Rs.c       # Name of .c output file for an include
  26.                                 # file generated in ExpandIncludes=0 mode.
  27.  
  28. SymCase # 1 or default=preserve case of Pascal idents,
  29.     # 0=convert all Pascal idents to lower case
  30.  
  31. SymbolFormat    # Format for C identifiers derived from
  32.     # Pascal ones; default=%s.    The following
  33.     # specific formats override this one.
  34.     # %s=original Pascal identifier,
  35.     # %S=name of parent module or procedure.
  36.  
  37. ConstFormat # Format for #define names derived from
  38.     # Pascal consts.    (Often used: %^s)
  39.  
  40. ModuleFormat    # Format for program and module names.
  41.  
  42. FunctionFormat    # Format for procedure and function names.
  43.  
  44. VarFormat    # Format for variable names.
  45.  
  46. TypeFormat    # Format for typedef names.
  47.  
  48. FieldFormat # Format for fields of records; %S=record type.
  49.  
  50. EnumFormat    # Format for enumeration constants;
  51.     # %s=enum type name.    If not specified,
  52.     # default is ConstFormat, else SymbolFormat.
  53.  
  54. ReturnValueName Result    # Return value holding variable; [%s=func name]
  55. UnitInitName    _%s_init    # Turbo Pascal unit initializer; %s=unit name
  56. HSymbolName %s_H    # Name of "_H" symbol, if any; %s=unit name
  57. GSymbolName %s_G    # Name of "_G" symbol; [%s=unit name]
  58. StringMaxName    MAX_%s    # VAR STRING hidden variable; %s=param name
  59. ArrayMinName    %s_LOW    # Lower bound hidden variable; %s=param name
  60. ArrayMaxName    %s_HIGH # Upper bound hidden variable; %s=param name
  61. CopyParName %s_ # Alternate name for parameter %s
  62. StaticLinkName    LINK    # Static link parameter name; [%s=func name]
  63. LocalVarsStruct LOC_%s    # Name of struct type for locals; %s=func name
  64. LocalVarsName    V    # Name of struct var for locals; [%s=func name]
  65. FwdStructName    %s    # Name of forward-used structs; %s=type name
  66.     # (may simply be %s if you don't mind confusion)
  67. EnumListName    %s_NAMES    # Name of array to hold names for enum %s
  68. UnionName    UU    # Name of variant union
  69. UnionPartName    %s    # Name of variant element; %s=tag value name
  70. FakeStructName    _REC_%s # Name of "temporary" structs; %s=base name
  71. LabelName    _L%s    # Name of GOTO label; %s=label name
  72. LabelVarName    _JL%s    # Name of GOTO label jmp_buf variable; %s=label
  73. TempName    TEMP%s    # Name of general temporary vars; %s=unique id
  74. DummyName    DUMMY%s # Name of throwaway "dummy" vars; %s=unique id
  75. WithName    WITH%s    # Name of WITH statement temp ptr; %s=unique id
  76. ForName FORLIM%s    # Name of FOR statement temp limit; %s=unique id
  77. PtrName PTR%s    # Name of NIL-checking temp ptr; %s=unique id
  78. StringName    STR%s    # Name of temporary string vars; %s=unique id
  79. SetName SET%s    # Name of temporary set vars; %s=unique id
  80. FNVarName    %s_NAME # Name of file-name vars; %s=file var
  81. FNSizeName    _FNSIZE # Maximum length of file name (macro or integer)
  82.  
  83. TagStructs                      # 1=Use FakeStructName for most unnamed records
  84.                 # 0 or default=only for arrays/files of records
  85.  
  86. AlternateName1    %s_ # Way to produce a second C symbol for a Pascal
  87.     # symbol, where original symbol was %s. Default
  88.     # is to use AlternateName with %d=1.
  89.  
  90. AlternateName2    # A second alternate for %s.
  91.  
  92. AlternateName    # A %d'th name for %s.  %s and %d may appear in
  93.     # either order. Default is %d applications of
  94.     # AlternateName1.
  95.  
  96. ExportSymbol    # Name of exported symbol %s.    E.g.: "P_%s"
  97.     # Default=%s, i.e., don't mess with the name.
  98.     # %s is Pascal symbol name; %S is module name.
  99.  
  100. Export_Symbol    # Exported-symbol format to be used when the
  101.     # symbol %s contains an '_'.    Default=use
  102.     # ExportSymbol format for every symbol.
  103.  
  104. Alias    # Name of external proc or var; default="%s".
  105.     # If does not contain a "%s", this simply
  106.     # renames the next defined symbol of any kind.
  107.  
  108. Synonym # Format:    Synonym name = newname
  109. Synonym # Treat the word "name" in the input file
  110. Synonym # exactly the same as the keyword or identifier
  111. Synonym # "newname".    If "newname" is omitted, ignore
  112. Synonym # the word "name" in the input. For example:
  113. Synonym # "Synonym andthen = and" creates a keyword;
  114. Synonym # "Synonym allocmem = getmem" simulates a
  115. Synonym # built-in function "allocmem" which acts like
  116. Synonym # Turbo's "getmem"; "Synonym segment" ignores
  117. Synonym # the word "segment" in the input.
  118.  
  119. NameOf    # Format:    NameOf name = newname
  120. NameOf    # Rename the specified symbol.    The name may
  121. NameOf    # be of the form "modulename.name" or
  122. NameOf    # "procname.name"; otherwise, all usages of
  123. NameOf    # the symbol are renamed.
  124.  
  125. VarMacro    # Format:    VarMacro varname = C-expression
  126. VarMacro    # Must come before the declaration of variable
  127. VarMacro    # "varname".    Causes all references to the
  128. VarMacro    # variable to use the C expression instead.
  129. VarMacro    # In the expr, all C operators are supported;
  130. VarMacro    # all identifier names are used verbatim.
  131. VarMacro    # Also works for Turbo Pascal typed-constants.
  132. VarMacro    # Suppresses declaration of variable unless
  133. VarMacro    # "varname" appears in the C expression.
  134. VarMacro    # Simple algebra is used for assignments to
  135. VarMacro    # vars with expr definitions: if X -> 2*V+1,
  136. VarMacro    # then "X:=Y" translates to "V=(Y-1)/2".
  137.  
  138. ConstMacro    # Analogous to VarMacro, but for constants and
  139. ConstMacro    # enumeration constants.    In an enum constant,
  140. ConstMacro    # if the C-expression is a single name the
  141. ConstMacro    # result is equivalent to Alias or NameOf.
  142.  
  143. FieldMacro    # Format:    FieldMacro rec.field = C-expression
  144. FieldMacro    # where "rec" is a record type name which
  145. FieldMacro    # also appears in the C-expression. For
  146. FieldMacro    # example: FieldMacro obj.foo = bar(obj) causes
  147. FieldMacro    # the field "foo" of record type "obj" to be
  148. FieldMacro    # referenced through the function or macro
  149. FieldMacro    # "bar", rather than using dot notation.
  150.  
  151. FuncMacro    # Format:    FuncMacro foo(a,b,c) = C-expression
  152. FuncMacro    # where "a", "b", "c" are arbitrary arg names
  153. FuncMacro    # also appearing in the C-expression.    "Foo"
  154. FuncMacro    # is a procedure or function defined or to be
  155. FuncMacro    # defined in the code, or predefined in Pascal.
  156. FuncMacro    # E.g.: FuncMacro PtInRect(p,r) = PtInRect(p,&r)
  157. FuncMacro    # causes "r" to be treated as a VAR param even
  158. FuncMacro    # though otherwise it would be passed by value.
  159.  
  160. WarnMacros    # 1=warn if Var/Const/Field/FuncMacro not used
  161.     # 0 or default=don't care.
  162.  
  163. SpecialMalloc    # Format:    SpecialMalloc x.y.z = funcname
  164. SpecialMalloc    # where x is a type name, and y and z are
  165. SpecialMalloc    # optional variant tags for records.    The
  166. SpecialMalloc    # statement "new(p,y,z)" where p is a pointer
  167. SpecialMalloc    # to x is converted to p = funcname().
  168.  
  169. SpecialFree # Like SpecialMalloc, but defines a special
  170. SpecialFree # function for freeing things of a given type.
  171.  
  172. SpecialSizeOf    # Like SpecialMalloc, but defines a name or
  173. SpecialSizeOf    # other integer-valued C expression which is
  174. SpecialSizeOf    # the size of an object of the given type.
  175.  
  176. AvoidName    getc    # If any of these names appear in the code,
  177. AvoidName    putc    # use an alternate name so as to avoid
  178. AvoidName    getchar # library conflicts.
  179. AvoidName    putchar
  180. AvoidName    feof    # These are typically macro names whose use
  181. AvoidName    ferror    # would be disasterous under any
  182. AvoidName    clearerr    # circumstances.
  183. AvoidName    fileno
  184. AvoidName    BUFSIZ    NULL    EOF
  185. AvoidName    stdin    stdout    stderr
  186. AvoidName    true false assert
  187. AvoidName    Anyptr Void Char PP PV
  188. AvoidName    Signed Const Volatile Register Static Local Inline
  189. AvoidName    cdecl far near huge
  190. AvoidName    isalpha isupper islower isdigit isxdigit isspace ispunct
  191. AvoidName    isalnum isprint isgraph iscntrl isascii toascii
  192. AvoidName    toupper tolower
  193. AvoidName    LINK SEXT
  194.  
  195. AvoidGlobalName fopen    # These names should be avoided in global
  196. AvoidGlobalName fclose    # contexts, but they are okay as local names.
  197. AvoidGlobalName fseek
  198. AvoidGlobalName exit    main
  199. AvoidGlobalName strcpy    strcat
  200. AvoidGlobalName printf    fprintf sprintf
  201. AvoidGlobalName scanf    fscanf    sscanf
  202. AvoidGlobalName malloc    realloc free
  203. AvoidGlobalName y0 y1 yn j0 j1 jn    # from math.h -- urghhh!
  204.     # ... we should define lots more of these!
  205.  
  206. WarnName    # A similar list of names to leave alone, but
  207. WarnName    # generate warnings for if they are defined.
  208.  
  209. WarnNames    # 1=All vars, consts, types, procs, fields
  210.     #    defined after this point should generate
  211.     #    warnings if used.
  212.     # 0 or default=no warnings for future names
  213.  
  214. WarnLibrary # A list of C functions, any calls to which
  215. WarnLibrary # should generate warnings.
  216.  
  217.  
  218.  
  219.  
  220.  
  221.